package edu.sctu.nieyu.day20150512.texttwo;


import java.util.ArrayList;
import java.util.List;

/**
 * Created by user01 on 2015/5/12.
 */
public class StudentOne extends Abstract implements Inter{



    StudentMessage[] studentarray ;







    public StudentOne(StudentMessage[] studentarray ){
        super(studentarray);
        this.studentarray = studentarray;

    }

    @Override
    public List<StudentMessage> getInformation() {

        List<StudentMessage>list = new ArrayList();


        for (int i = 0; i < 10; i++) {

            if (studentarray[i].getGrade() > 60) {

                list.add(studentarray[i]);
            }


        }
            return list;
//.在TextChild和TextChildTwo新增一个方法，该方法有一个接口类型的参数,
       // 接口方法里面有判断年龄参数age,调用接口判断年龄大于age的数据，
       // 并在新增方法里面进行输出年龄大于age的总人数
             //   和基本信息
       // System.out.println(textTheres[i].getName()+"  "+textTheres[i].getGrade()+"  " +
                //""+textTheres[i].getNumber()+"  "+textTheres[i].getAge()+"  "+textTheres[i].getAdress());
    }
    public void getString(int age){

        List<StudentMessage> list = new ArrayList();

        for (int i = 0; i < 10; i++) {
            if(studentarray[i].getAge()>age){
               list.add(studentarray[i]);
            }




        }
        System.out.println("总人数："+list.size());
        System.out.println(list);

    }

    }




